#include "stdafx.h"
#include "Vao.h"
#include "RenderState.h"

namespace a2d
{
//------------------------------------------------------------------

	bool VAO::Create()
	{
		if (!m_vao)
			glGenVertexArrays(1, &m_vao);
		return true;
	}

	void VAO::Bind()
	{
		RenderState::Get().SetVAO(m_vao);
	}

	void VAO::Destroy()
	{
		RenderState::Get().SetVAO(0);
		glDeleteVertexArrays(1, &m_vao);
		m_vao = 0;
	}

//------------------------------------------------------------------
} // namespace a2d
